﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.Shen.GeneralContracts;
using Volo.Abp.Application.Services;

namespace TianShiProject.Shen.GeneralContracts
{
    public class GeneralContractShenService : ApplicationService
    {
        private readonly IGeneralContractShenRepository _generalContractRepository;
        public GeneralContractShenService(IGeneralContractShenRepository generalContractRepository)
        {
            _generalContractRepository = generalContractRepository;
        }
        /// <summary>
        /// 提交审批
        /// </summary>
        /// <param name="generalContractShenDto"></param>
        /// <param name="loginname"></param>
        /// <param name="loginid"></param>
        /// <returns></returns>
        public async Task<int> PostAddGeneralContract(GeneralContractShenDto generalContractShenDto, string loginname, int? loginid)
        {
            return await _generalContractRepository.PostAddGeneralContract(generalContractShenDto,loginname, loginid);
        }
        /// <summary>
        /// 显示审批
        /// </summary>
        /// <param name="title"></param>
        /// <param name="danwei"></param>
        /// <param name="fuzeren"></param>
        /// <param name="jingbanren"></param>
        /// <param name="qianding"></param>
        /// <returns></returns>
        public async Task<PageResponse<GeneralContractShenDto>> GetShowGeneralContract(string title, string danwei, string fuzeren, string jingbanren, DateTime? qianding, int pageindex = 1, int pagesize = 3)
        {
            return await _generalContractRepository.GetShowGeneralContract(title, danwei, fuzeren, jingbanren, qianding, pageindex, pagesize);
        }
        /// <summary>
        /// 待审批显示
        /// </summary>
        /// <param name="title"></param>
        /// <param name="danwei"></param>
        /// <param name="fuzeren"></param>
        /// <param name="jingbanren"></param>
        /// <param name="qianding"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<GeneralContractShenDto>> GetDaiGeneralContract(string title, string danwei, string fuzeren, string jingbanren, DateTime? qianding, int pageindex = 1, int pagesize = 3)
        {
            return await _generalContractRepository.GetDaiGeneralContract(title, danwei, fuzeren, jingbanren, qianding, pageindex, pagesize);
        }
        /// <summary>
        /// 已审批显示
        /// </summary>
        /// <param name="title"></param>
        /// <param name="danwei"></param>
        /// <param name="fuzeren"></param>
        /// <param name="jingbanren"></param>
        /// <param name="qianding"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<GeneralContractShenDto>> GetYiGeneralContract(string title, string danwei, string fuzeren, string jingbanren, DateTime? qianding, int pageindex = 1, int pagesize = 3)
        {
            return await _generalContractRepository.GetYiGeneralContract(title, danwei, fuzeren, jingbanren, qianding, pageindex, pagesize);
        }
        /// <summary>
        /// 审批通过
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> PutTongGeneralContract(Guid id)
        {
            return await _generalContractRepository.PutTongGeneralContract(id);
        }
        /// <summary>
        /// 审批拒绝
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> PutJuGeneralContract(Guid id)
        {
            return await _generalContractRepository.PutJuGeneralContract(id);
        }
    }
}
